{% extends "index.html" %}

{% block scripts %}
	<script type="text/javascript" charset="utf-8">
		$(document).ready(function() {$('.hint').tooltip({
			position: 'center right',
			effect: 'fade'
		})});
	</script>
{% endblock %}

{% block inline_navi %}
Registrieren
{% endblock %}

{% block box_title %}
	Registrieren
{% endblock %}
{% block box_content %}
<p>
    Hier kannst du dich für campusshare registrieren. Das einzige, was von den anderen Usern zu sehen ist, ist dein Benutzername.
</p>

<div id="detail_table">
    <h3>Anmeldeformular</h3>
    <form action="{% url usermanagement.views.registerview %}" enctype="multipart/form-data" method="post">
        {% csrf_token %}
        {{ form.non_field_errors }}
        <table>
			<!-- Username -->
            <tr>
                {% if form.username.errors %}
                <th class="form_error"><label for="id_username">Freier Benutzername ist erforderlich*:</label></th>
                {% else %}
                <th><label for="id_username">Benutzername*:</label></th>
                {% endif %}
                <td>{{ form.username }}</td>
            </tr>
            <!-- Password -->
            <tr>
                {% if form.password.errors %}
                <th class="form_error"><label for="id_password">Passwort erforderlich*:</label></th>
                {% else %}
                <th><label for="id_password">Passwort*:</label></th>
                {% endif %}
                <td>{{ form.password }}</td>
            </tr>
            <!-- Password repetition -->
            <tr>
                {% if form.password_repetition.errors %}
                <th class="form_error"><label for="id_password_repetition">Passwort richtig wiederholen*:</label></th>
                {% else %}
                <th><label for="id_password_repetition">Passwort (Wiederholung)*:</label></th>
                {% endif %}
                <td>{{ form.password_repetition }}</td>
            </tr>
            <!-- E-Mail -->
            <tr>
                {% if form.email.errors %}
                <th class="form_error"><label for="id_email">Freie Uni-Mail-Adresse erforderlich*:</label></th>
                {% else %}
                <th><label for="id_email">E-Mail*:</label></th>
                {% endif %}
                <td>{{ form.email }}</td>
                <td><div class="hint" title="E-Mail Adresse des RHRK oder SCI" /></td>
            </tr>
            <!-- First Name -->
            <tr>
                {% if form.first_name.errors %}
                <th class="form_error"><label for="id_first_name">Vorname erforderlich*:</label></th>
                {% else %}
                <th><label for="id_first_name">Vorname*:</label></th>
                {% endif %}
                <td>{{ form.first_name }}</td>
            </tr>
            <!-- Last Name -->
            <tr>
                {% if form.last_name.errors %}
                <th class="form_error"><label for="id_last_name">Nachname erforderlich*:</label></th>
                {% else %}
                <th><label for="id_last_name">Nachname*:</label></th>
                {% endif %}
                <td>{{ form.last_name }}</td>
            </tr>
            <!-- Accept Rules -->
            <tr>
                {% if form.accept_rules.errors %}
                <th class="form_error"><label for="id_accept_rules">Du musst die <a target="about:blank" href="/impressum/">Nutzungsregeln/Datenschutzregeln/Haftungsausschluss</a> akzeptieren*:</label></th>
                {% else %}
                <th><label for="id_accept_rules"><a target="about:blank" href="/impressum/">Nutzungsregeln/AGBs</a> akzeptieren*:</label></th>
                {% endif %}
                <td>{{ form.accept_rules }}</td>
            </tr>            
            <tr>
                <td colspan="3" align="center" style="padding-top: 10px;">
                    <input type="submit" value="Registrieren" />
                </td>
            </tr>
        </table>
    </form>
</div>

{% endblock %}
